package com.dkm.biz.gl.repository.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.gl.domain.EavValueText;
import com.dkm.biz.gl.persistence.dao.EavValueTextQueryDao;
import com.dkm.biz.gl.persistence.entity.EavValueTextPo;
import com.dkm.biz.gl.repository.EavValueTextRepository;
import com.dkm.biz.repository.AbstractRepository;

/**
 * 对象功能:属性大文本值 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:Yuki
 * 创建时间:2014-12-19 10:21:40
 */
@Repository
public class EavValueTextRepositoryImpl extends AbstractRepository<String, EavValueTextPo,EavValueText> implements EavValueTextRepository{
	  
	@Resource
	private  EavValueTextQueryDao eavValueTextQueryDao;

	public EavValueText newInstance() {
		EavValueTextPo po = new EavValueTextPo();
		EavValueText eavValueText = SpringHelper.getBean(EavValueText.class);
		eavValueText.setData(po);
		return eavValueText;
	}

	public EavValueText newInstance(EavValueTextPo po) {
		EavValueText eavValueText = SpringHelper.getBean(EavValueText.class);
		eavValueText.setData(po);
		return eavValueText;
	} 
	
	@Override
	protected IQueryDao<String, EavValueTextPo> getQueryDao() {
		return eavValueTextQueryDao;
	}
	@Override
	public EavValueTextPo findByProdAttr(String entityId, String attrId){
		 Map<String,Object> params=new HashMap<String,Object>();
			params.put("entityId",entityId);
			params.put("attrId", attrId);
			return eavValueTextQueryDao.getByKey("findByProdAttr", params);
	}
	
	
	
}
